package com.betterjr.modules.profit;

import com.alibaba.dubbo.config.annotation.Reference;
import com.betterjr.common.web.Servlets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

import static com.betterjr.common.web.ControllerExceptionHandler.exec;


/**
 * Created by chenlj on 2018/7/12
 */
@Controller
@RequestMapping(value = "/Scf/FundingParty")
public class FundingPartyController {

    private static final Logger logger = LoggerFactory.getLogger(FundingPartyController.class);

    @Reference(interfaceClass = IScfProfitService.class)
    private  IScfProfitService scfProfitService;

    @RequestMapping(value = "/indexData", method = RequestMethod.POST)
    public @ResponseBody String indexData (HttpServletRequest request) {
        Map<String, Object> map = Servlets.getParametersStartingWith(request, "");
        String providerId = "11";
        return exec(() -> scfProfitService.webQueryFundingPartyIndexData(map), "查询资金方首页数据", logger);
    }


}
